package cn.zt.controller;

import cn.zt.common.Result;
import cn.zt.domain.TUserFinancial;
import cn.zt.service.TUserFinancialService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @program: 反正路也要一个人走
 * @author: Mr.Mao
 * @create: 2024-09-05 20:13
 **/
@RestController
@RequestMapping("/financial")
public class FinancialController {

    @Resource
    private TUserFinancialService userFinancialService;

    //购买理财产品
    @PostMapping("/buying")
    public Result buying(TUserFinancial userFinancial) {
        Result result = userFinancialService.buying(userFinancial);
        return result;
    }

    //购买理财的清单
    @GetMapping("/getByUserIdList")
    public Result getByUserIdList(Integer userId) {
        Result result = userFinancialService.getByUserIdList(userId);
        return result;
    }

    @PostMapping("/getRansom")
    public Result getRansom(TUserFinancial userFinancial) {
        Result result = userFinancialService.getRansom(userFinancial);
        return result;
    }
}
